package com.kamistoat.ruoyi.ruoyigateway.service;

import com.kamistoat.ruoyi.ruoyicommoncore.exception.CaptchaException;
import com.kamistoat.ruoyi.ruoyicommoncore.web.domain.AjaxResult;

import java.io.IOException;

/**
 * 验证码服务接口
 */
public interface ValidateCodeService {
    /**
     * 生成验证码
     *
     * @return 前后端响应体
     * @throws IOException
     * @throws CaptchaException
     */
    public AjaxResult createCaptcha() throws IOException, CaptchaException;

    /**
     * 校验验证码
     *
     * @param code 前端输入的验证码
     * @param uuid redis缓存标识
     * @throws CaptchaException
     */
    public void checkCaptcha(String code, String uuid) throws CaptchaException;
}
